from django.db import models

class ApiLog(models.Model):
    name = models.CharField("接口名称", max_length=128)
    RESULT_CHOISE = (
        (0, "执行成功"),
        (1, "执行失败"),
    )
    result = models.IntegerField("执行结果", choices=RESULT_CHOISE, default=0)
    input = models.TextField("输入")
    output = models.TextField("输出")
    created = models.DateTimeField("创建时间", auto_now_add=True, null=True, blank=True)
    updated = models.DateTimeField("更新时间", auto_now=True, null=True, blank=True)

    def __str__(self):
        return f"接口日志-{self.name}"

    class Meta:
        verbose_name = verbose_name_plural = "接口日志管理"